<?
//Überprüfen ob der Abruf über die Hauptseite erfolgt
if(!defined('InStern')) exit;
?>

<?
if($_POST['do']=="sendRundmail")
{
    $text = $_POST["text"];
    require("class/mail.class.php");
    $mail = new Mail(true);
    $mail->setFrom("support@mixax.de");
    $mail->setSubject($_POST["betreff"]);
    $mail->setBody($text);
    $mail->addRecipient($_POST["empfaenger"]);
    $mail->setTemplate(file_get_contents("templates/email.html"));
    $mail->send();
}
else
{
  echo "
  <form action=\"index.php\" method=\"post\" onsubmit=\"setReady4Submit()\">
   <input type=\"hidden\" name=\"do\" value=\"sendRundmail\"/>
   <b>Empf&auml;nger:</b>
   <input type=\"text\" name=\"empfaenger\" style=\"width:100%\" value=\"" . $_GET["to"] . "\" /><br>
   <b>Betreff:</b>
   <input type=\"text\" name=\"betreff\" style=\"width:100%\" value=\"Rundmail\"/><br>";
   echo richeditor("text");
   echo "
   <br>
   <input type=\"submit\" value=\"Rundmail versenden\"/>
  </form>";
}
   
